/**
 * 
 */
package com.nari.heatshare.dao;

import java.util.Date;
import java.util.List;

import com.nari.coreframe.dao.hibernate3.IGenericDao;
import com.nari.heatshare.model.IUserShareResult;
import com.nari.platform.model.PageCond;
import com.nari.platform.model.ResultWithPageCond;

/**
 * 
 * @author Xiaopeng
 * @date 2013-8-19
 */
public interface IUserShareResultDao extends IGenericDao<IUserShareResult, String> {

	/**
	 * 分页查询用户分摊结果
	 * @param projectUID 所属项目(可选)
	 * @param communityUID 所属小区(可选)
	 * @param buildingUID 所属楼栋(可选)
	 * @param heatRoomUID 所属热用户(可选)
	 * @param pageCond
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-10-6
	 */
	public ResultWithPageCond<IUserShareResult> queryUserShareResultPage(String projectUID, 
			String communityUID, String buildingUID, String heatRoomUID, 
			PageCond pageCond) throws Exception;
	
	/**
	 * 通过分摊域分摊ID批量删除对应的用户分摊
	 * @param areaResultUID
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-10-8
	 */
	public void deleteUserResultByAreaResultUID(String areaResultUID) throws Exception;
	
	/**
	 * 通过分摊域分摊ID分页查询所属的用户分摊列表
	 * @param areaResultUID 分摊域分摊ID(必填)
	 * @param roomOwner 户主姓名(可选)
	 * @param houseNo 门牌号(可选)
	 * @param pageCond
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-10-16
	 */
	public ResultWithPageCond<IUserShareResult> queryUserPageByAreaResultUID(String areaResultUID, 
			String roomOwner, String houseNo, PageCond pageCond) throws Exception;
	
	/**
	 * 统计热用户在指定时段内的分摊账单数量
	 * @param roomId
	 * @param startDate
	 * @param endDate
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2014-4-30
	 */
	public int countUserResultByPeriod(String roomId, Date startDate, Date endDate) throws Exception;
	
	/**
	 * 查询热用户在指定时段内的分摊账单(取参考散热量的最大值)
	 * @param roomId
	 * @param startDate
	 * @param endDate
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2014-5-3
	 */
	public List<IUserShareResult> queryUserResultByPeriod(String roomId, Date startDate, 
			Date endDate) throws Exception;
}
